<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>

<%@page import="java.util.List"%>
<%@page import="java.util.ArrayList"%>
<%@page import="com.msti.entity.Course"%>
<%@page import="com.msti.entity.Student"%>
<%@page import="java.util.Iterator"%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Course Selection</title>
<link rel="stylesheet" type="text/css" href="css/common.css" />
</head>

<body>
<div class="wrapper">	
	<form action = "StudentDetail2.do" method = "post" id="courses_selection" class="form">
<h2>Select your courses</h2>
		<!--<p class="instructions">select course :</p>-->
		<ul>
<%
	List<Course> courses = (ArrayList<Course>)request.getAttribute("courses");
	Student student = (Student)request.getAttribute("student");
	request.getSession().setAttribute("student", student);
	//request.getSession().setAttribute("student",student);
	if(courses != null){
	Iterator<Course> iterator = courses.iterator();
	while(iterator.hasNext()){
		Course course = iterator.next();
	%>
			<li>
				<input type="hidden" value="<%=student.getStudentID()%>"/>
				<input type="checkbox" name="course" value="<%=course.getCourseId() %>" /> <%=course.getName() %><br />
			</li>
<%} }
	else{
		response.sendRedirect("errorLogin.jsp");
	}

%>
		</ul>
		<input type="submit" value="Send"/>
</form>
	<div class="company_name_bar"><marquee direction="left">Mercantile Seamen Training Institute Ltd.</marquee></div>
</div>
</body>
</html>